livepatch: Tighten alignment checks.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 23 Jun 2017 16:41:45 +0000 (12:41 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 5 Oct 2017 13:27:32 +0000 (09:27 -0400)
commitc3f951417f8837e9e2061e592e9cce95bd09095b
tree89a325ea9f8f22be6246a4342483f02691c12762
parent511321c4aa6d8864655ad4e9e9ebfed45b8ecafc
livepatch: Tighten alignment checks.

The ELF specification mentions nothing about the sh_size being
modulo the sh_addralign. Only that sh_addr MUST be aligned on
sh_addralign if sh_addralign is not zero or one.

We on loading did not take this in-to account so this patch adds
a check on the ELF file as it is being parsed.

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/common/livepatch_elf.c